package com.shuxinxin.test.service.impl;

import com.shuxinxin.test.mapper.UserMapper;
import com.shuxinxin.test.pojo.User;
import com.shuxinxin.test.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;


    @Override
    public User login(String username, String password) {
        return userMapper.login(username, password);
    }

    @Override
    public int reg(String username, String password, String nickname) {
        return userMapper.insertUser(username, password, nickname);
    }

    @Override
    public User selectUser(String username) {
        return userMapper.selectUserById(username);
    }
}
